package cn.com.nes.site.entity.em;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

public enum InstallPictureEnum {

    DESIGN("design","设计图"),
    PLAN_VIEW("planView", "平面图"),
    HOUSE_HOLDER_HOLDING_ID_CARD_AND_DEVICE("idCardAndDevice", "户主手持身份证与设备合影"),
    ENTRANCE_DOOR_INCLUDES_HOUSE_NUMBER("entranceDoorIncludesHouseNumber", "入户门（含门牌号）"),
    HEATING_BUILDING_OVERVIEW("heatingBuilding", "取暖建筑概况"),
    DEVICE_FRONT("deviceFront", "机器正面"),
    DEVICE_SIDE("deviceSide", "机器侧面"),
    NAMEPLATE_AND_BARCODE("nameplateAndBarcode", "铭牌及条形码"),
    ELECTRICITY_MERTER_AND_METER_BOX("electricityMeterAndMeterBox", "电表及电表箱"),
    WATER_TANK_OR_PUMP("waterTankOrPump", "水箱水泵"),

    ;


    private String key;

    private String value;

    InstallPictureEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static String getVal(String key) {
        if (ObjectUtil.isNull(key)) {
            return StrUtil.EMPTY;
        }
        Map<String, String> map = Arrays.stream(values())
                .collect(Collectors.toMap(InstallPictureEnum::getKey, InstallPictureEnum::getValue));
        return map.get(key);
    }
}
